package cn.qyd.javastring;

import java.util.Date;

/**
 * @author 邱运铎
 * 比较字符串拼接中+和StringBuild拼接字符串的性能比较
 * @date 2024-03-09 21:33
 */
public class StringBuildAppendDemo {
    public static void main(String[] args) {
        Long date = System.currentTimeMillis();
        System.out.println(date);
//        String result = "";
//        for(int i = 0; i < 100000; i++) {
//            result += "六六六";
//        }
        StringBuilder stringBuilder = new StringBuilder();
        for(int i = 0; i < 100000; i++) {
            stringBuilder.append("六六六");
        }
        Long date1 = System.currentTimeMillis();
        System.out.println(date1);
        System.out.println(date1 - date);
    }
}
